Demo for rolling: 4 sided: [8]> (setf d4 (make-instance 'dice :numberOfFaces 4)) # [9]> (examine-all d4) Face: 1 Number of face: 4 History: NIL NIL [10]> (roll d4) NIL [11]> (examine-all d4) Face: 1 Number of face: 4 History: (1) NIL [12]> (roll d4) NIL [13]> (examine-all d4) Face: 3 Number of face: 4 History: (1 3) NIL 6 sided: [14]> (setf d6 (make-instance 'dice)) # [16]> (examine-all d6) Face: 1 Number of face: 6 History: NIL NIL [17]> (roll d6) NIL [18]> (examine-all d6) Face: 5 Number of face: 6 History: (5) NIL [19]> (roll d6) NIL [20]> (examine-all d6) Face: 3 Number of face: 6 History: (5 3) NIL 12 sided: Demo for roll-for-pair: [7]> (setf dice1 (make-instance 'dice)) # [8]> (setf dice2 (make-instance 'dice)) # [9]> (roll-for-pairs dice1 dice2) NIL [10]> (examine-all dice1) Face: 1 History: (3 4 4 4 5 3 1) NIL [11]> (examine-all dice2) Face: 1 History: (2 5 5 2 4 2 1) NIL [12]> (roll-for-pairs dice1 dice2) NIL [13]> (examine-all dice1) Face: 2 History: (3 4 4 4 5 3 1 5 6 1 6 5 2) NIL [14]> (examine-all dice2) Face: 2 History: (2 5 5 2 4 2 1 6 2 5 4 2 2) Demo for roll-for-sum: [17]> (setf dice1 (make-instance 'dice)) # [18]> (setf dice2 (make-instance 'dice)) # [19]> (roll-for-sum dice1 dice2 8) NIL [20]> (examine-all dice1) Face: 3 History: (4 5 1 5 3 2 3) NIL [21]> (examine-all dice2) Face: 5 History: (2 6 3 5 2 1 5) NIL [22]> (roll-for-sum dice1 dice2 5) NIL [23]> (examine-all dice1) Face: 1 History: (4 5 1 5 3 2 3 5 3 5 2 5 2 5 4 4 4 4 2 1) NIL [24]> (examine-all dice2) Face: 4 History: (2 6 3 5 2 1 5 5 4 6 6 1 1 3 4 5 2 6 4 4) Demo for the rest: (a) [19]> (setf a (make-instance 'accumulator)) # [20]> (setf d1 (make-instance 'dice)) # [21]> (setf d2 (make-instance 'dice)) # [22]> (examine-accumulator a) Accumulator is at: 0 NIL [23]> (roll-for-pairs-accumulated d1 d2 a) NIL [24]> (examine-accumulator a) Accumulator is at: 5 NIL [25]> (examine-all d1) Face: 5 Number of face: 6 History: (5 4 5 1 5) NIL [26]> (examine-all d2) Face: 5 Number of face: 6 History: (3 2 6 3 5) NIL (b) [28]> (establish 3 12) # [29]> (roll-for-pairs-accumulated d1 d2 a) NIL [30]> (examine-accumulator a) Accumulator is at: 2 NIL [31]> (examine-all d1) Face: 2 Number of face: 3 History: (2 2) NIL [32]> (examine-all d2) Face: 2 Number of face: 12 History: (4 2) NIL (c) [34]> (establish 6 6) NIL [35]> (examine-all d1) Face: 1 Number of face: 6 History: NIL NIL [36]> (examine-all d2) Face: 1 Number of face: 6 History: NIL NIL [37]> (examine-accumulator a) Accumulator is at: 0 NIL [38]> (roll-for-sum-accumulated d1 d2 7 a) NIL [39]> (examine-accumulator a) Accumulator is at: 5 NIL [40]> (examine-all d2) Face: 2 Number of face: 6 History: (6 4 6 1 2) NIL [41]> (examine-all d1) Face: 5 Number of face: 6 History: (3 4 6 1 5) NIL (d) [42]> (establish 3 12) NIL [43]> (examine-all d1) Face: 1 Number of face: 3 History: NIL NIL [44]> (examine-all d2) Face: 1 Number of face: 12 History: NIL NIL [45]> (examine-accumulator a) Accumulator is at: 0 NIL [46]> (roll-for-sum-accumulated d1 d2 7 a) NIL [47]> (examine-all d1) Face: 1 Number of face: 3 History: (1) NIL [48]> (examine-all d2) Face: 6 Number of face: 12 History: (6) NIL [49]> (examine-accumulator a) Accumulator is at: 1 NIL (e) [50]> (establish 6 6) NIL [51]> (examine-all d1) Face: 1 Number of face: 6 History: NIL NIL [52]> (examine-all d2) Face: 1 Number of face: 6 History: NIL NIL [53]> (examine-accumulator a) Accumulator is at: 0 NIL [54]> (roll-for-sum-accumulated d1 d2 11 a) NIL [55]> (examine-all d1) Face: 5 Number of face: 6 History: (6 6 3 1 1 1 3 3 2 6 1 3 2 5 6 6 1 4 3 2 1 1 4 4 1 6 6 5 5) NIL [56]> (examine-all d2) Face: 6 Number of face: 6 History: (2 1 6 1 2 4 1 4 5 3 5 2 2 1 6 1 3 1 1 5 1 3 2 6 3 3 4 2 6) NIL [57]> (examine-accumulator a) Accumulator is at: 29 NIL (f) [58]> (establish 3 12) NIL [59]> (examine-all d1) Face: 1 Number of face: 3 History: NIL NIL [60]> (examine-all d2) Face: 1 Number of face: 12 History: NIL NIL [61]> (examine-accumulator a) Accumulator is at: 0 NIL [62]> (roll-for-sum-accumulated d1 d2 11 a) NIL [63]> (examine-all d1) Face: 3 Number of face: 3 History: (3 3 1 1 1 3 3) NIL [64]> (examine-all d2) Face: 8 Number of face: 12 History: (5 10 6 7 12 9 8) NIL [65]> (examine-accumulator a) Accumulator is at: 7 NIL (g) [69]> (establish 6 6) NIL [70]> (test711pairs d1 d2 a) Face: 2 Number of face: 6 History: (2) Face: 5 Number of face: 6 History: (5) Accumulator is at: 1 NIL [71]> (establish 6 6) NIL [72]> (test711pairs d1 d2 a) Face: 3 Number of face: 6 History: (3) Face: 4 Number of face: 6 History: (4) Accumulator is at: 1 NIL [73]> (establish 6 6) NIL [74]> (test711pairs d1 d2 a) Face: 6 Number of face: 6 History: (1 6) Face: 5 Number of face: 6 History: (2 5) Accumulator is at: 2 NIL (h) [67]> (establish 3 12) NIL [68]> (test711pairs d1 d2 a) Face: 1 Number of face: 3 History: (1) Face: 10 Number of face: 12 History: (10) Accumulator is at: 1 NIL